
public class LigneCommande {
	private Article a;
	private int quantite;
	private int numCommande;
	private double total;
	
	public LigneCommande(){
		a = new Article();
		quantite = 0;
		numCommande = 0;
		total = 0;
	}
	

	public LigneCommande(Article a, int quantite, int numCommande) {
		this.a = a;
		this.quantite = quantite;
		this.numCommande = numCommande;
		this.setTotal();
	}


	public Article getArticle() {
		return a;
	}

	public void setArticle(Article a) {
		this.a = a;
	}

	public int getQuantite() {
		return quantite;
	}

	public void setQuantite(int quantite) {
		if (quantite < 0)
			System.err.println("Quantite invalide");
		else	
			this.quantite = quantite;
	}

	public int getNumCommande() {
		return numCommande;
	}

	public void setNumCommande(int numCommande) {
		this.numCommande = numCommande;
	}

	public double getTotal() {
		return total;
	}

	public void setTotal() {
		this.total = a.getPu() * quantite ;
	}
	
}
